<style>
    .indexPage-taskshowTable-content {
        width: 100%;
    }
    #i-taskshow-tableHtml .layui-table-view {
        margin-top: 0px;
    }
</style>
<script type="text/html" template lay-done="layui.data.indexPageTaskshowTabledone(d);">
    <table id="i-taskshow-tableHtml" lay-filter="i-taskshow-tableHtml" class='indexPage-taskshowTable-content'>
    </table>
</script>
<script>
layui.data.indexPageTaskshowTabledone = function (d) {
    layui.use(['admin','table'], function () {
        var table = layui.table;

		rederTable(d.params.list);
		
        function rederTable(data) {
			var options = {
				elem: '#i-taskshow-tableHtml',
				data: data,
				limit: 100,
				cols: [
					[{
						field: 'taskname',
						title: '任务名称',
						//style: 'border-color: #fff; color: #333333;'
					}, {
						field: 'formMsg',
						width: 200,
						title: '表单',
						//style: 'border-color: #fff; color: #333333;',
						templet: function(d) {
                            var str ='';
                            layui.each(d.formMsg,function(i,e){
                                str += e.formname+' ';
                            });
                            return str;
                        }
					}, {
						field: 'tasktype',
						width: 120,
						title: '任务类型',
                        //style: 'border-color: #fff; color: #333333;',
                        templet: '常驻任务'
					}, {
						field: 'statename',
						width: 90,
						title: '状态',
						//style: 'border-color: #fff; color: #333333;',
					}]
				]
			};
			table.render(options);
		};

		//表格行点击事件
		table.on('row(i-taskshow-tableHtml)', function(obj){
			var data = obj.data,
			id = data.id;
			location.hash = '/task/permanent/index/isEdit=1/id='+id;
		})

    })
};
</script>